<?php

use think\facade\Route;

/** 题目管理 */
Route::group('/admin/question/topic', function () {
    Route::get('list', 'index'); // 列表
    Route::get('create', 'create'); // 新增 - 页面
    Route::post('create', 'create'); // 新增 - 提交
    Route::group('<id>', function () {
        Route::get('edit', 'edit'); // 修改 - 页面
        Route::put('edit', 'edit'); // 修改 - 提交
        Route::delete('delete', 'delete'); // 删除
        Route::get('info', 'info');// 详情
    })->pattern(['id' => '\d+']);
    // 题目选择面板
    Route::get('choose/options', 'chooseOptions');
    // 获取题目列表
    Route::get('choose/list', 'getChooseList');
})->prefix('\app\exam\service\admin\QuestionTopic@')->middleware(['adminRoute']);

/** 试题关联信息 */
Route::group('/admin/question/topic/<topic_id>/', function () {
    Route::get('paper/list', '@linkPaperList');
})->prefix('\app\exam\service\admin\QuestionTopicLinks')
    ->pattern(['topic_id' => '\d+'])
    ->middleware(['adminRoute']);